<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <title>视频列表</title>
    <link rel="shortcut icon" th:href="@{/favicon.ico}"/>
    <link rel="stylesheet" th:href="@{/static/bootstrap/css/bootstrap.min.css}">
    <script th:src="@{/static/js/jquery-3.3.1.min.js}"></script>
    <script th:src="@{/static/bootstrap/js/bootstrap.min.js}"></script>
</head>
<body>
<div class="col-sm-8 col-sm-offset-2 col-md-11 col-md-offset-1 main">
    <div class="text-right ">
        <span class="glyphicon glyphicon-hand-right" aria-hidden="true"></span>
        <a th:href="@{toAdminHome}">点此返回主页</a>
    </div>
    <div class="container-fluid">
        <ul class="nav navbar-nav">
            <li><a href="getVideoListByAdmin">最新视频</a> </li>
            <li><a  href="getVideoListByHeatByAdmin" class="text-info">最热视频</a></li>
            <li><a  href="getVideoListBySystemByAdmin" class="text-info">系统推送</a></li>

        </ul>
    </div>
    <form class="navbar-form navbar-right"  method="get" role="search" th:action="@{getVideoByNameByAdmin}">
        <div class="form-group">
            <input type="text" class="form-control" placeholder="请输入视频名关键字" name="title">
        </div>
        <button type="submit" class="btn navbar-btn">搜索</button>
    </form>

    <table class="table table-hover">
        <thead>
        <tr>
            <th>#</th>
            <th>文件名</th>
            <th>文件作者</th>
            <th>文件类型</th>
            <th>上传时间</th>
            <th>播放量</th>
            <th>下载量</th>
            <th>评论量</th>
            <th>播放</th>
            <th>推送</th>
            <th>删除</th>
        </tr>
        </thead>
        <tbody th:if="${pageInfo != null}">
        <!--        <c:if test="${!empty videoList}">-->
        <!--            <c:forEach var="video" items="${videoList.list}">-->
        <tr th:each="video:${pageInfo.list}">
            <td th:text="${video.id}"></td>
            <td th:text="${video.title}"></td>
            <td th:text="${video.author}"></td>
            <td th:text="${video.type}"></td>
            <td th:text="${video.uploadTime}"></td>
            <td th:text="${video.vv}"></td>
            <td th:text="${video.download}"></td>
            <td th:text="${video.tc}"></td>
            <!--                    th:href="@{'videoPlayByIdAndAdmin?id='+${video.id }}"  -->
            <td>
                <button><a th:href="@{'videoPlayByIdAndAdmin?id='+${video.id }}">播放</a></button>
            </td>
            <td>
                <button>
                    <a th:if="${video.push != 1}" th:text="推送" th:href="@{'videoPushByIdAndAdmin?id='+${video.id }}"></a>
                    <a th:if="${video.push == 1}" th:text="取消" th:href="@{'videoPushByIdAndAdmin?id='+${video.id }}"></a>
                </button>

            </td>
            <td>
                <button><a th:href="@{'deleteVideoById?id='+${video.id}}">删除</a></button>
            </td>
        </tr>
        <!--            </c:forEach>-->
        <!--        </c:if>-->
        </tbody>
    </table>
    <!-- 分页信息 -->
    <div class="col-md-6">
        当前<span class="label label-default" th:text="${pageInfo.pageNum }"></span>页
        |总<span class="label label-default" th:text="${pageInfo.pages }"></span>页
        |有<span class="label label-default" th:text="${pageInfo.total }"></span>个视频.
    </div>
    <div class="col-md-6">
        <nav aria-label="Page navigation">
            <ul class="pagination">
                <li><a th:href="@{'getVideoList'}">首页</a></li>
                <!--                <c:if test="${videoList.hasPreviousPage}">-->
                <li th:if="pageInfo.hasPreviousPage">
                    <a th:href="@{'getVideoList?pageNum='+${pageInfo.pageNum-1}}" aria-label="Previous">
                        <span aria-hidden="true">&laquo;</span>
                    </a>
                </li>
                <!--                </c:if>-->
                <!--                <c:forEach items="${videoList.navigatepageNums}" var="navigatepageNums">-->
                <!--                    <c:if test="${navigatepageNums==videoList.pageNum }">-->
                <!--                        <li class="active"><a>${navigatepageNums }</a></li>-->
                <!--                    </c:if>-->
                <!--                    <c:if test="${navigatepageNums!=videoList.pageNum }">-->
                <!--                        <li><a href="${APP_PATH}/getAllVideo2?pn=${navigatepageNums}">${navigatepageNums }</a></li>-->
                <!--                    </c:if>-->
                <!--                </c:forEach>-->
                <!--                <c:if test="${videoList.hasNextPage}">-->
                <li th:if="${pageInfo.hasNextPage}">
                    <a th:href="@{'getVideoList?pageNum='+${pageInfo.pageNum+1}}" aria-label="Next">
                        <span aria-hidden="true">&raquo;</span>
                    </a>
                </li>
                <!--                </c:if>-->
                <li><a th:href="@{'getVideoList?pageNum='+${pageInfo.pages }}">末页</a></li>
            </ul>
        </nav>
    </div>
</div>
</body>

</html>
